package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LitemallUserGoodsMapper;
import org.linlinjava.litemall.db.domain.LitemallUserGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LitemallUserGoodsService {

    @Autowired
    private LitemallUserGoodsMapper litemallUserGoodsMapper;


    public LitemallUserGoods queryUserGoods(String username){

        return litemallUserGoodsMapper.queryUserGoods(username);
    }

    /**
     * 查询全部商户
     * */
   public List<LitemallUserGoods> queryAll(){
        return litemallUserGoodsMapper.queryAll();
   }

    public  LitemallUserGoods queryUsername(String username){
        return   litemallUserGoodsMapper.queryUsername(username);
    }

    /**
     * 新建商户
     * @Parma litemallUserGoods
     * */
    public int insertUserGoods(LitemallUserGoods litemallUserGoods){
        return litemallUserGoodsMapper.addUserGoods(litemallUserGoods);
    }

    /**
     * 修改商户状态
     * */

    public int updateStat(int id,int deleteId){
       return litemallUserGoodsMapper.updateDeleteId(id,deleteId);
    }
    public int deleteById(int id){
        return litemallUserGoodsMapper.deleteById(id);
    }
}
